home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / rap101.zip / MENUCOL.RAP < prev    next >
Text File  |  1988-11-01  |  2KB  |  107 lines

  1. ;menucol.rap - demonstrating advanced menu features
  2. ;rs 11-1-88
  3.  
  4. if $screentype <> "ansi"
  5.     t:Sorry... you'll need the ANSI.SYS driver installed for this program.
  6.     bye
  7. end if
  8.  
  9. $reverse=*chr(27)[7m
  10. $norm=*chr(27)[0m
  11.  
  12. $month[1]=January
  13. $month[2]=February
  14. $month[3]=March
  15. $month[4]=April
  16. $month[5]=May
  17. $month[6]=June
  18. $month[7]=July
  19. $month[8]=August
  20. $month[9]=September
  21. $month[10]=October
  22. $month[11]=November
  23. $month[12]=December
  24.  
  25. menu
  26.     cls
  27.     t:Month selection:  pick by typing unique part of name (and Enter)
  28.  
  29.     option accept("Ja.*"): *dispname(1)
  30.         #choice=1
  31.  
  32.     option accept("F.*"): *dispname(2)
  33.         #choice=2
  34.  
  35.     option accept("Mar.*"): *dispname(3)
  36.         #choice=3
  37.  
  38.     option accept("Ap.*"): *dispname(4)
  39.         #choice=4
  40.  
  41.     option accept("May"): *dispname(5)
  42.         #choice=5
  43.  
  44.     option accept("Jun.*"): *dispname(6)
  45.         #choice=6
  46.  
  47.     option accept("Jul.*"): *dispname(7)
  48.         #choice=7
  49.  
  50.     option accept("Au.*"): *dispname(8)
  51.         #choice=8
  52.  
  53.     option accept("S.*"): *dispname(9)
  54.         #choice=9
  55.  
  56.     option accept("O.*"): *dispname(10)
  57.         #choice=10
  58.  
  59.     option accept("N.*"): *dispname(11)
  60.         #choice=11
  61.  
  62.     option accept("D.*"): *dispname(12)
  63.         #choice=12
  64.  
  65.     option accept("j","ju","m","ma","a")
  66.         t:*go(7,3) Not enough...
  67.         pause 5
  68.         repeat
  69.  
  70. end menu: *go(7,3) Pick a month:$blank
  71.  
  72. th:*gospot(#choice)$reverse$month[#choice]$norm
  73. ca 7,1
  74. cl
  75. t:Thank you.
  76. foot
  77. run
  78.  
  79. str function *blanks(#n)
  80.     declare $manyblank=                                        $blank_
  81.  
  82.     return *mid($manyblank,1,#n)
  83. end function
  84.  
  85. str function *go(#row,#col)
  86.  
  87.     return "*chr(27)[#row;#col\H"
  88.  
  89. end function
  90.  
  91.  
  92. string function *gospot(#n)
  93.  
  94.     declare #row,#col
  95.     #row = (#n-1) mod 3 + 3
  96.     #col = (#n-1) / 3 * 20 + 2
  97.  
  98.     return "*chr(27)[#row;#col\H"
  99.  
  100. end function
  101.  
  102. string function *dispname(#n)
  103.  
  104.     return "*gospot(#n)$month[#n]"
  105.  
  106. end function
  107.